﻿<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="TiposDeHabitacion.aspx.vb" Inherits="Hosteria_VS_TiposDeHabitacion" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div>
    
        Mantenimiento de Tipos de Habitaciones<br />
    
    </div>
    <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" DataKeyNames="Id" 
        DataSourceID="sdaTiposDeHabitacion" 
        EmptyDataText="No hay registros de datos para mostrar." 
        AllowSorting="True">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" >
            <ItemStyle Width="100px" />
            </asp:CommandField>
            <asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True" 
                SortExpression="Id" >
            <ItemStyle Width="80px" HorizontalAlign="Right" />
            </asp:BoundField>
            <asp:BoundField DataField="Descripcion" HeaderText="Descripcion" 
                SortExpression="Descripcion" >
            <ItemStyle Width="150px" />
            </asp:BoundField>
            <asp:BoundField DataField="Precio" HeaderText="Precio" 
                SortExpression="Precio" >
            <ItemStyle Width="100px" HorizontalAlign="Right" />
            </asp:BoundField>
        </Columns>
    </asp:GridView>
    <br />
    <table style="width: 234px">
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td class="style2">
                Id</td>
            <td class="style3">
                Descripción</td>
            <td class="style4">
                Precio</td>
        </tr>
        <tr>
            <td class="style1">
    <asp:LinkButton ID="btnAgregar" runat="server">Agregar</asp:LinkButton>
            </td>
            <td class="style2">
    <asp:TextBox ID="txtId" runat="server" Width="80px"></asp:TextBox>
            </td>
            <td class="style3">
    <asp:TextBox ID="txtDescripcion" runat="server"></asp:TextBox>
            </td>
            <td class="style4">
    <asp:TextBox ID="txtPrecio" runat="server"></asp:TextBox>
            </td>
        </tr>
    </table>
    <br />
    <asp:SqlDataSource ID="sdaTiposDeHabitacion" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TESTConnectionString %>" 
        DeleteCommand="DELETE FROM [TipoHabitacion] WHERE [Id] = @Id" 
        InsertCommand="INSERT INTO [TipoHabitacion] ([Id], [Descripcion], [Precio]) VALUES (@Id, @Descripcion, @Precio)" 
        ProviderName="<%$ ConnectionStrings:TESTConnectionString.ProviderName %>" 
        SelectCommand="SELECT [Id], [Descripcion], [Precio] FROM [TipoHabitacion]" 
        UpdateCommand="UPDATE [TipoHabitacion] SET [Descripcion] = @Descripcion, [Precio] = @Precio WHERE [Id] = @Id">
        <DeleteParameters>
            <asp:Parameter Name="Id" Type="Int16" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Id" Type="Int16" />
            <asp:Parameter Name="Descripcion" Type="String" />
            <asp:Parameter Name="Precio" Type="Decimal" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Descripcion" Type="String" />
            <asp:Parameter Name="Precio" Type="Decimal" />
            <asp:Parameter Name="Id" Type="Int16" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>
